import UEntity from "../ecs/Entity/UEntity";
import { MoveComponent } from "./MoveComponent";
import { PositionComponent } from "./PositionComponent";

const { ccclass, property } = cc._decorator;

@ccclass
export default class LabelObj extends UEntity {

    public moveComp: MoveComponent = new MoveComponent()
    public positionComp: PositionComponent = new PositionComponent()
    start() {
        this.positionComp.x = this.node.x
        this.positionComp.y = this.node.y
        this._entity.addComponent(this.moveComp);
        this._entity.addComponent(this.positionComp);
    }
    update() {
        this.node.x = this.positionComp.x
        this.node.y = this.positionComp.y
    }

}
